<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的收藏</title>
    <link rel="icon" href="/hire/imgs/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/hire/css/common/nav_left.css">
    <link rel="stylesheet" href="/hire/css/user/center/mycollection.css">
<%--    <link rel="stylesheet" href="/hire/plugins/bootstrap/css/bootstrap.css">--%>
    <link rel="stylesheet" href="/hire/plugins/layui/css/layui.css">
</head>

<body>
<%@include file="../../common/mynav.jsp"%>
<div class="middler">
    <div class="inner">
        <div class="left">
            <div class="menu-list">
                <ul class="menu">
                    <li><a href="/hire/user/employee_info">个人中心</a></li>
                    <li><a href="/hire/user/resume_center">简历中心</a></li>
                    <li><a href="/hire/user/resume_view">谁看过我</a></li>
                    <li><a href="/hire/user/mydelivery">我的投递</a></li>
                    <li class="active"><a href="/hire/user/mycollection">我的收藏</a></li>
                    <li><a href="/hire/user/myblacklist">我的屏蔽</a></li>
                    <li><a href="/hire/user/account_settings">账号设置</a></li>
                </ul>
            </div>
        </div>
        <div class="right">
            <div class="title">
                <h2>我的收藏</h2>
            </div>
        </div>
        <div class="big">
            <div class="layui-anim layui-anim-up">

                <table class="layui-table" lay-size="lg" lay-skin="line" style="background-color: white;">
                    <colgroup>
                        <col width="200">
                        <col width="300">
                        <col width="150">
                        <col width="150">
                        <col width="150">
                    </colgroup>
                    <thead>
                    <tr>
                        <th>职位名</th>
                        <th>公司名</th>
                        <th>工作地点</th>
                        <th>薪资</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>

                        <c:forEach items="${employeeCollectionAndCompamyAndRecruitmentDTOList}" var="employeeCollectionAndCompamyAndRecruitmentDTOList">
                            <div class="col-md-12" id="col">
                                <tr>
                                    <td><input type="checkbox" name="cks" id="aaa"><a href="/hire/job/recruitment/recruitmentinfo?id=${employeeCollectionAndCompamyAndRecruitmentDTOList.recruitment.id}">${employeeCollectionAndCompamyAndRecruitmentDTOList.recruitment.name}</a></td>
                                    <td><a href="/hire/job/company/companyinfo?id=${employeeCollectionAndCompamyAndRecruitmentDTOList.company.id}">${employeeCollectionAndCompamyAndRecruitmentDTOList.company.name}</a></td>
                                    <td>${employeeCollectionAndCompamyAndRecruitmentDTOList.company.city}${employeeCollectionAndCompamyAndRecruitmentDTOList.company.district}</td>
                                    <td>${employeeCollectionAndCompamyAndRecruitmentDTOList.recruitment.salaryLower}k-${employeeCollectionAndCompamyAndRecruitmentDTOList.recruitment.salaryUpper}k</td>
                                    <td>${employeeCollectionAndCompamyAndRecruitmentDTOList.stat}&nbsp;|&nbsp;&nbsp;<button type="button" onclick="delColl(${employeeCollectionAndCompamyAndRecruitmentDTOList.recruitment.id})" id="hide_${employeeCollectionAndCompamyAndRecruitmentDTOList.recruitment.id}" style="background-color: white;border: 0">取消</button></td>

                                </tr>
                            </div>
                        </c:forEach>
<%--                    <tr>--%>
<%--                        <td><input type="checkbox" name="" id="" onclick="selectAll(this)">全选</td>--%>
<%--                        <td></td>--%>
<%--                        <td></td>--%>
<%--                        <td></td>--%>
<%--                        <td>--%>
<%--                            <div class="op">--%>
<%--                                <span><button type="button">删除</button></span>--%>
<%--                                <span><button type="button">申请</button></span>--%>
<%--                            </div>--%>
<%--                        </td>--%>
<%--                    </tr>--%>
                    </tbody>
                </table>
            </div>


        </div>
    </div>
</div>
<%@include file="../../common/myfooter.jsp" %>
    <script>
        function delColl(rid){
            $.post('/hire/user/delete/collection',{rid:rid},function (res) {
                if (res.code=='200') {
                    layer.msg("删除成功")
                    location.reload();
                }
                else
                    layer.msg("删除失败")
            })
        }

        let tbody = document.getElementById("tb");
        let count = 0;

        function selectAll(obj) {
            //1. 获取下面所有的checkbox
            let cks = document.getElementsByName("cks");

            if (obj.checked) {
                for (let i = 0; i < cks.length; i++) {
                    cks[i].checked = true;
                }
            } else {
                for (let i = 0; i < cks.length; i++) {
                    cks[i].checked = false;
                }
            }
        }
        
        <%--window.onload=function() {--%>
        <%--    if (${employeeCollectionAndCompamyAndRecruitmentDTOList.stat}.equals("投递")){--%>

        <%--    }--%>

        <%--}--%>


    </script>
    <script src="/hire/plugins/jquery/jquery.min.js"></script>
    <script src="/hire/plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="/hire/plugins/layui/layui.js"></script>
    <script>
        layui.use(['laypage', 'layer'], function () {
            var laypage = layui.laypage
                , layer = layui.layer;

            //总页数低于页码总数
            laypage.render({
                elem: 'demo0'
                , count: 50 //数据总数
            });
        });


    </script>
<%--    <%@include file="../../common/myfooter.jsp" %>--%>
</body>

</html>